package com.zhike.controller;

import com.zhike.service.DwsAlarmBtWindowService;
import com.zhike.service.DwsAlarmWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhike
 * @CreateTime: 2024/5/1
 * @Description: 告警主题的controller
 */
@RestController
@RequestMapping("alarm")
public class AlarmTodayController {
    @Autowired
    private DwsAlarmWindowService dwsAlarmWindowService;

    @Autowired
    private DwsAlarmBtWindowService dwsAlarmBtWindowService;
    /**
     * 获取当日每辆车的告警次数
     */
    @PostMapping("getAlarmCountToday")
    public String getAlarmCountToday(@RequestBody String filter){
        return dwsAlarmWindowService.getAlarmCountToday(filter);
    }

    /**
     * 获取当日各车型的告警次数
     */
    @PostMapping("getAlarmTypeToday")
    public String getAlarmTypeToday(@RequestBody String filter){
        return dwsAlarmBtWindowService.getAlarmTypeToday(filter);
    }

    /**
     * 获取当日各品牌的告警次数
     */
    @PostMapping("getAlarmBrandToday")
    public String getAlarmBrandToday(@RequestBody String filter){
        return dwsAlarmBtWindowService.getAlarmBrandToday(filter);
    }


}
